<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>京选友惠</title>
    <link rel="stylesheet" href="../css/aui.2.0.css">
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/alert.css">
    <link rel="stylesheet" href="../css/discountMall.css">
	<style>
        .dis-price>span:nth-child(1){
            width: 40%;
        }
    </style>
</head>
<body style="background-color: #f0f0f0">
<header>
    <div class="aui-searchbar" id="search">
        <div class="aui-searchbar-input aui-border-radius">
            <form class="search-form">
                <i class="aui-iconfont aui-icon-search"></i>
                <input type="search" placeholder="请输入搜索内容" id="search-input" autocomplete="off">
                <div class="aui-searchbar-clear-btn" id="clean-search">
                    <i class="aui-iconfont aui-icon-close"></i>
                </div>
            </form>
        </div>
        <div class="aui-searchbar-btn aui-text-info" tapmode>搜索</div>
    </div>
</header>
<nav style="margin-top:2rem;">
    <div id="dis-list-vessel"></div>
    <div class="loading">加载更多...</div>
    <div class="no-info">没有更多信息了...</div>
    <div class="footer-height"></div>
    <div class="all-mask"></div>
</nav>
<!--底部工具栏-->
<footer class="aui-bar aui-bar-tab" id="footer">
    <a href="homePage.html">
        <div class="aui-bar-tab-item " tapmode>
            <img src="../img/home_no.png" alt="" class="footer-icon-img">
            <div class="aui-bar-tab-label">首页</div>
        </div>
    </a>
    <a href="discountMail.html">
        <div class="aui-bar-tab-item " tapmode>
            <img src="../img/discount_no.png" alt="" class="footer-icon-img">
            <div class="aui-bar-tab-label">友惠精选</div>
        </div>
    </a>
    <a href="javascript:;">
        <div class="aui-bar-tab-item aui-active" tapmode>
            <img src="../img/JD_click.png" alt="" class="footer-icon-img">
            <div class="aui-bar-tab-label">京东VIP</div>
        </div>
    </a>
    <a href="cart.html">
        <div class="aui-bar-tab-item" tapmode>
            <!--<div class="aui-badge">99</div>-->
            <img src="../img/cart_no.png" alt="" class="footer-icon-img">
            <div class="aui-bar-tab-label">购物车</div>
        </div>
    </a>
    <a href="member.html">
        <div class="aui-bar-tab-item" tapmode>
            <!--<div class="aui-dot"></div>-->
            <i class="aui-iconfont aui-icon-my"></i>
            <div class="aui-bar-tab-label">我的</div>
        </div>
    </a>
</footer>
<script type="text/x-handlebars-template" id="discount-list-template">
    {{#each list}}
    <a href="javascript:;" class="display-box">
        <div class="dis-list-box" data-id="{{id}}" data-sku="{{sku}}" data-couponurl="{{conUrlB}}">
            <div class="dis-shop-img">
                <img src="../img/lazy.gif" data-src="{{goodsUrl}}" alt="">
            </div>
            <div class="dis-list-content">
                <div class="dis-shop-detail">
                    <span class="hongbao youhuiquan" style="display:none;">红包 <span>{{conTicketPrice}}</span>元</span>
                    <span class="dis-shop-name">{{goodsName}}</span>
                </div>
                <div class="dis-shop-price-xiaol">
                    <span>京东价 : ￥{{oriPrice}}</span>
                    <!--<span>销量 : 5</span>-->
                </div>
				<div class="dis-shop-youh-box">
                    <div class="dis-youh-left">
                        <span class="dis-r-text">券后价</span>
                        <span class="dis-r-price">￥{{conPrice}}</span>
                    </div>
                    <div class="dis-youh-right">
                        <span class="hongbao-pay">红包立减</span>
                        <span>{{conTicketPrice}}元</span>
                    </div>
                </div>
                <!--
				<div class="dis-price">
                    <span>￥{{conPrice}}</span>
                    <span>京东价 :￥{{oriPrice}}</span>
                </div>
				<div class="dis-sale">
             	       库存：<span>{{goodsInventory}}</span>
                </div>-->
            </div>
        </div>
    </a>
    {{/each}}
</script>
<script src="../js/jquery-3.0.0.min.js"></script>
<script src="../js/aui-lazyload.js"></script>
<script src="../js/config.js"></script>
<script src="../js/alert.js"></script>
<script src="../js/search.js"></script>
<script src="../js/function.js"></script>
<script src="../js/handlebars-v4.0.10.js"></script>
<script src="../js/common.js"></script>
<script src="../js/aui-lazyload.js"></script>
<script src="../js/jd_shop.js"></script>
<script>
    /**
     * 判断是iOS或是安卓，改变数据的获取方式
     *
     * */
    var ua = navigator.userAgent.toLowerCase();
    if (/iphone|ipad|ipod/.test(ua)) {
        //alert('iOS的弹窗');
        var data={
            postType:'getToken'
        };
        postSuccessToken(data);

    } else {
        //alert('android的弹窗。');
        //postAndroidToken();
    }

    //调用ios获取token方法。
    function postSuccessToken(data) {
        window.webkit.messageHandlers.postSuccessToken.postMessage(data);
    }

    //调用Android获取token方法
    function postAndroidToken() {
        window.huifa.getToken();
    }

    function getToken(token) {
        localStorage.setItem('token',token);

        //alert('获取到的token为'+token);
    }
</script>
</body>
</html>